package com.hub.realtime.resource.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hub.realtime.common.annotation.Excel;
import com.hub.realtime.common.core.domain.BaseEntity;

/**
 * Jar包管理对象 res_jar_management
 *
 * @author wupeng
 * @date 2022-01-14
 */
@Data
@TableName("res_jar_management")
public class ResJarManagement extends BaseEntity<ResJarManagement>
{
    private static final long serialVersionUID = 1L;

    /** id */
    @TableId(value="id", type= IdType.AUTO)
    private Long id;

    /** 项目id */
    @TableField("application_id")
    @Excel(name = "项目id")
    private Long applicationId;

    /** 文件名 */
    @TableField("file_name")
    @Excel(name = "文件名")
    private String fileName;

    /** 路径 */
    @TableField("description")
    @Excel(name = "路径")
    private String description;

    /** 类型(flink|dep|function) */
    @TableField("jar_type")
    @Excel(name = "类型(flink|dep|udf)")
    private String jarType;

    /** jar包来源(git|upload) */
    @TableField("jar_source")
    @Excel(name = "jar包来源(git|upload)")
    private String jarSource;

    /** 路径 */
    @TableField("file_path")
    @Excel(name = "路径")
    private String filePath;

    /** 函数名 */
    @TableField("func_name")
    @Excel(name = "函数名")
    private String funcName;

    /** 入口类 */
    @TableField("main_class")
    @Excel(name = "入口类")
    private String mainClass;

    /** 随机code */
    @TableField("uid")
    @Excel(name = "随机code")
    private String uid;

    /** 用户id */
    @TableField("user_id")
    @Excel(name = "用户id")
    private Long userId;

    @TableField("remark")
    @Excel(name = "用户id")
    private String remark;

    @TableField("in_use")
    private boolean inUse;

    @TableField("git_jar_id")
    private Long gitJarId;

    @TableField(exist = false)
    private String tmpPath;

    @TableField(exist = false)
    private String applicationName;


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("applicationId", getApplicationId())
                .append("fileName", getFileName())
                .append("description", getDescription())
                .append("jarType", getJarType())
                .append("jarSource", getJarSource())
                .append("filePath", getFilePath())
                .append("funcName", getFuncName())
                .append("mainClass", getMainClass())
                .append("updateTime", getUpdateTime())
                .append("updateBy", getUpdateBy())
                .append("createTime", getCreateTime())
                .append("createBy", getCreateBy())
                .append("uid", getUid())
                .append("userId", getUserId())
                .append("remark", getRemark())
                .toString();
    }
}

